/**
 * 
 */
package foodserver;


import javax.servlet.http.*;
import javax.servlet.*;

import java.io.*;


import org.json.JSONException;
import org.json.JSONObject;

import com.subway.babynote.syncdata.ClientDataRecord;

import querysrc.query_RegUser;
import querysrc.query_RegVisitor;
import querysrc.sqlConnectionHandler;
import querysrc.sqlConnectionHandlerManager;

/**
 * @author zfp
 *
 */



public class RegVisitor extends addbase {
	 /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	 query_RegVisitor qa = null;	 

	/**
	 * 
	 */
	public RegVisitor() {
		// TODO Auto-generated constructor stub
	}
	protected void initialize_subquery()
	{
		qa = new query_RegVisitor(this.sqlconhandler);
	}
	protected void destory_subquery()
	{
		this.release_query(qa);
	}
	protected int add_data(JSONObject input_jsono)
	{
		try
		 {	
			ClientDataRecord.visitorRecord vr = new ClientDataRecord.visitorRecord(input_jsono);
			 
			 int id = qa.Register(vr);
		     return id;			 
		     
		 }		
		 catch (Exception e) {
			 System.out.println("FeedSync doPost error:" + e.getMessage());
		      e.printStackTrace();
		      return -1;
		    }
	}	
	 	

}
